﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Threading;
using System.Windows.Media.Animation;

namespace WpfAnimation
{
    /// <summary>r
    /// 
    /// PageParallelTimeline.xaml 的交互逻辑
    /// </summary>
    public partial class PageParallelTimeline : Page
    {
        DispatcherTimer timer;
        public PageParallelTimeline()
        {
            InitializeComponent();
            timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick += new EventHandler(timer_Tick);
        }

        void timer_Tick(object sender, EventArgs e)
        {
            FirstTextBlock.Text = (DateTime.Now - dtNow).Seconds.ToString();
        }
        DateTime dtNow;
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            dtNow = DateTime.Now;
            timer.Start();
        }
    }
}
